package com.lagou.bean;

import com.lagou.service.HelloService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;

@Component
public class ConsumerComponent {


    //可以指定负载均衡的策略，不指定就是默认随机
//        @Reference(loadbalance = "roundrobin")
    //        @Reference(loadbalance = "random")
//        @Reference(loadbalance = "consistenthash")
        //自定义的负载均衡
            @Reference(loadbalance = "onlyFirst")
//    @Reference
    private HelloService helloService;

    public String sayHello(String name, int timeToWait) {
        return helloService.sayHello(name, timeToWait);
    }

}
